const express = require('express');
const router = express.Router();

router.get('/forCurrentUser', (req, res) => {
    const content = [];
    for(let i = 0; i < 40; i++) content.push({
        id: `${i}`,
        wholesaleDealerCode: `wholesaleDealerCode${i}`,
        stockMonth: '2020-03-12T08:22:56.266Z',
        country: '中国',
        stockQuantity: 21311,
        dealerId: '3124124',
        stockType: 1,
    });

    res.json({
        message: 'ok',
        payload: {
            content,
            totalElements: 40,
        }
    });
});

router.get('/details', (req, res) => {
    res.json({
        message: 'ok',
        payload: {
            id: '001',
            stockMonth: '2020-03-12T08:24:12.684Z',
            stockType: 1,
            wholesaleDealerCode: 'wholesaleDealerCode',
            country: 'country',
            stockQuantity: 12,
            details: [
                {
                    id: 'id001',
                    productCode: 'productCode',
                    brandCode: 'brandCode',
                    vehicleModelCode: 'vehicleModelCode',
                    annoucementNumber: 'annoucementNumber',
                    productGroupCode: 'productGroupCode',
                    color: 'color',
                    quantity: 2143,
                },
            ],
        },
        totalElements: 40,
    });
});
router.post('/forKD/import', async(req, res) => {
    res.json({
        message: '导入整车KD工厂车辆成功'
    });
});
router.post('/forDealer/import', async(req, res) => {
    res.json({
        message: '导入整车总代车辆导入成功'
    });
});
router.get('/forCurrentUser/export', (req, res) => {
    res.json({
        message: '导出成功',
        payload: 'Mock导出'
    });
});
router.get('/forCurrentUser/exportDetails', (req, res) => {
    res.json({
        message: '导出明细成功',
        payload: 'Mock导出'
    });
});
module.exports = router;
